package com.cstor.liang.utils;

import org.joda.time.DateTime;
import org.springframework.validation.BindingResult;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/8/11.
 */
public class WebUtil {

    /**
     * 获取 BindingResult 校验错误
     * @param error
     * @return
     */
    public static String bindingResultCollect(BindingResult error){
        return error.getAllErrors()
                .stream()
                .map(e -> e.getDefaultMessage())
                .reduce("", (a, b) -> a + b + "; ");
    }

    public static int computing(int x){
        int result = 1;
        for (int i = 1; i <= x; i++)
            result *= i;
        return result;
    }

    public static int com2(String str) {
        int sum = 1, x = 0;
        char[] array = null;
        array = (str + "(").toCharArray();
        for (char c : array){
            if (c == '(' && x != 0){
                sum *= computing(x);
                x = 0;
            }
            if (c == ')')
                x++;
        }

        return sum;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        System.out.println(com2(str));
    }
}
